package com.three.lab.bean;

import android.os.Parcel;
import android.os.Parcelable;

public class CommentBean implements Parcelable {

    private int id;
    private String userName;
    private String content;
    private String time;
    private boolean good;
    private boolean bad;

    public CommentBean() {
    }

    public CommentBean(int id, String userName, String content, String time, boolean good, boolean bad) {
        this.id = id;
        this.userName = userName;
        this.content = content;
        this.time = time;
        this.good = good;
        this.bad = bad;
    }

    protected CommentBean(Parcel in) {
        id = in.readInt();
        userName = in.readString();
        content = in.readString();
        time = in.readString();
        good = in.readByte() != 0;
        bad = in.readByte() != 0;
    }

    public static final Creator<CommentBean> CREATOR = new Creator<CommentBean>() {
        @Override
        public CommentBean createFromParcel(Parcel in) {
            return new CommentBean(in);
        }

        @Override
        public CommentBean[] newArray(int size) {
            return new CommentBean[size];
        }
    };

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getTime() {
        return time;
    }

    public void setTime(String time) {
        this.time = time;
    }

    public boolean isGood() {
        return good;
    }

    public void setGood(boolean good) {
        this.good = good;
    }

    public boolean isBad() {
        return bad;
    }

    public void setBad(boolean bad) {
        this.bad = bad;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(id);
        dest.writeString(userName);
        dest.writeString(content);
        dest.writeString(time);
        dest.writeByte((byte) (good ? 1 : 0));
        dest.writeByte((byte) (bad ? 1 : 0));
    }
}
